home *** CD-ROM | disk | FTP | other *** search
- Path: cpsc.ucalgary.ca!parker
- From: parker@cpsc.ucalgary.ca (Jim Parker)
- Newsgroups: comp.lang.c,comp.lang.pl1
- Subject: Re: GOTO controversy
- Date: 27 Feb 1996 02:33:22 GMT
- Organization: University of Calgary CPSC
- Message-ID: <4gtqhi$r8q@linux.cpsc.ucalgary.ca>
- References: <rcshlds.1.000A6705@mailserv.mta.ca> <Dn8pJ8.nqs@emi.net> <4grt4e$8fg@goanna.cs.rmit.EDU.AU>
- NNTP-Posting-Host: albert.cpsc.ucalgary.ca
-
- In article <4grt4e$8fg@goanna.cs.rmit.EDU.AU>,
- > >Robert C Shields (rcshlds@mailserv.mta.ca) wrote:
- >
- >Is there any reason why the GOTOs can't be replaced by
- >the particular action routine?
- >
- Yup. Clearly, if malloc fails we have 5 calls to clean up; each
- successive error needs fewer cleanup calls.
-
- I have encountered the same thing with simple files, and with
- allocation of complex linked structures. It is almost always
- true that GOTOs are misused, but not exclusively, and there are
- places where it cleans things up a bit.
-
- >It makes it clumsy to read such code.
-
- Not if it is all on the same page.
-
-
- --
- Jim Parker parker@cpsc.ucalgary.ca
- Laboratory for Computer Vision
- Department of Computer Science 403-220-6784
- University of Calgary 403-284-4707 (FAX)
-